home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / lastcall.dxr / 00082_Ice in mixing glass behavior.ls < prev    next >
Encoding:
Text File  |  2000-03-27  |  1.1 KB  |  55 lines

  1. property pSpr, pIceAmount, pEmptyGlass, pHalfGlass, pFullGlass, pIcePerScoop, pMaxIceIncrements, pLocH
  2.  
  3. on beginSprite me
  4.   pSpr = sprite(me.spriteNum)
  5.   pLocH = pSpr.locH
  6.   pIceAmount = 0
  7.   pEmptyGlass = member("mix_empty")
  8.   pHalfGlass = member("mix_half")
  9.   pFullGlass = member("mix_full")
  10.   pMaxIceIncrements = 1
  11.   pIcePerScoop = getCapacity(#mixingGlass) / (2.0 * pMaxIceIncrements)
  12.   mEmptyGlass(me)
  13. end
  14.  
  15. on mRemoveDrink me
  16.   mHideDrink(me)
  17.   mEmptyGlass(me)
  18. end
  19.  
  20. on mHideDrink me
  21.   pSpr.locH = 1000
  22. end
  23.  
  24. on mShowDrink me
  25.   pSpr.locH = pLocH
  26. end
  27.  
  28. on mEmptyGlass me
  29.   pIceAmount = 0
  30.   pSpr.member = pEmptyGlass
  31. end
  32.  
  33. on endSprite me
  34. end
  35.  
  36. on mFillIce me, masterSprite
  37.   if (pIceAmount + 1) < pMaxIceIncrements then
  38.     newMem = pHalfGlass
  39.   else
  40.     if (pIceAmount + 1) = pMaxIceIncrements then
  41.       newMem = pFullGlass
  42.     else
  43.       alertBeep()
  44.       return 0
  45.     end if
  46.   end if
  47.   return addIce(pSpr, masterSprite, pMaxIceIncrements, newMem, getAt(["ice_into_mglass1", "ice_into_mglass2"], pIceAmount + 1))
  48. end
  49.  
  50. on mRefreshIce me
  51.   if pIceAmount = pMaxIceIncrements then
  52.     pSpr.member = pFullGlass
  53.   end if
  54. end
  55.